const express = require('express')
const router = express.Router()
const expressJOI=require('@escook/express-joi')
const {
  getUserInfo,
  updateUserInfo,
  updatePassword,
  updateAvanter
} = require('../router_handler/userinfo')
const {
  updated_userinfo_schema,
  updated_password_schema,
   updated_avatar_schema
} = require('../schema/user')
// 获取用户基本信息
router.get('/getuserinfo', getUserInfo)
// 更新用户基本信息
router.post('/updateuserinfo', expressJOI(updated_userinfo_schema), updateUserInfo)
// 更新密码
router.post('/updatepwd', expressJOI(updated_password_schema), updatePassword)
module.exports = router
// 更新用户头像
router.post('/update/avatar', expressJOI(updated_avatar_schema), updateAvanter)